#include <iostream>
#include <stdlib.h>
#include <string>

using namespace std;

struct Stack
{
    int data [100];
    int top;
};

Stack* init()
{
    Stack* s=(Stack* )malloc(sizeof(Stack));
    if(s==NULL)
    {
        cout<<"error no enough story"<<endl;
        exit (0);
    }
    memset(s->data,0,sizeof(s->data));
    s->top=0;
    return s;
}

void push(Stack* s,int data)
{
   
        s->data[s->top]=data;
        s->top++;
}

void pop(Stack* s)
{
    while(s->top!=0)
    {
        s->data[s->top]=0;
        s->top--;
    }
}

void display(Stack* s)
{
    for(int i=s->top-1;i>=0;i--)
    {
        cout<<s->data[i];
    }
    cout<<endl;
}

int main()
{
    Stack* s=init();
    int putin[5]={11,22,33,44,55};
    for(int i=0;i<5;i++)
    {
        push(s,putin[i]);
    }

    display(s);

    pop(s);
    display(s);

    system("pause");
    return 0;
}




    
